This document is adapted from the Bar Charts section of the Altair Example Gallery.

Our first step is to set up our environment:

Anscombe’s Quartet

Altair example

Chart

Becker’s Barley Trellis Plot

Altair example

Chart

Binned Scatterplot

Altair example

Chart

Bubble Plot

Altair example

Chart

Connected Scatterplot (Lines with Custom Paths)

Altair example

Chart

Dot Dash Plot

Altair example

Inspired by Edward Tufte’s Visual Display of Quantitative Information (p. 133), this is based on g3o2’s block. It is also interactive, you can make an interval selection on the scatterplot.

Chart

Gapminder Bubble Plot

Altair example

This example is modified from an example in Lisa Charlotte Rost’s blog post ‘One Chart, Twelve Charting Libraries’.

Chart

Multifeature Scatter Plot

Altair example

Chart

Natural Disasters

Altair example

Chart

Polynomial Fit Plot

Altair example

TODO: need to recreate this example, thinking about “tidy” workflow

Chart

Scatter Matrix

Altair example

Chart

Simple Scatter Plot with Labels

Altair example

Layering can now work with the + operator as it does in Python. Additionally, it can be declared as alt$layer(chart1, chart2) or as alt$ChartLayer(layer = list(chart1, chart2))

Chart

Table Bubble Plot (Github Punch Card)

Altair example

Chart

Trellis Scatter Plot

Altair example

This example demonstrates the need for a ggplot2::facet_wrap()-like capability, which we understand is coming to Vega-Lite in the no-so-distant future.

Chart